package com.ssy.lingxi.platform.manage.repository;

import com.ssy.lingxi.platform.manage.entity.content.MaterialLibrary;
import com.ssy.lingxi.platform.manage.entity.content.MemberCategory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface MaterialLibraryRepository extends JpaRepository<MaterialLibrary, Long>, JpaSpecificationExecutor<MaterialLibrary> {

    MaterialLibrary findFirstByFileNameAndMemberIdAndMemberRoleId(String fileName,Long memberId,Long roleId);

    List<MaterialLibrary> findByIdInAndMemberIdAndMemberRoleId(List<Long> idList,Long memberId,Long memberRoleId);

    List<MaterialLibrary> findByMemberIdAndMemberRoleId(Long memberId, Long memberRoleId);

}
